<template>
  <div class="operate-bar">
    <slot name="condition"></slot>
    <div class="btn-group">
      <template>
        <el-button v-if="showSearch" type="primary" @click="$emit('search')"
          >查询</el-button
        >
        <el-button
          v-if="showAdd"
          type="primary"
          icon="el-icon-plus"
          @click="$emit('add')"
          >新增</el-button
        >
      </template>
      <template>
        <slot name="operate"></slot>
        <el-button v-if="showSave" type="primary" @click="$emit('save')"
          >保存</el-button
        >
        <el-button v-if="showBack" type="info" @click="$emit('back')"
          >返回</el-button
        >
      </template>
    </div>
  </div>
</template>

<script>
export default {
  props: {
    showSearch: {
      type: Boolean,
      default: false,
    },
    showAdd: {
      type: Boolean,
      default: false,
    },
    showSave: {
      type: Boolean,
      default: false,
    },
    showBack: {
      type: Boolean,
      default: false,
    },
  },
};
</script>

<style lang="scss" scoped>
</style>